package com.example.service.impl;

import com.example.pojo.VehicleRecord;
import com.example.mapper.VehicleRecordMapper;
import com.example.service.IVehicleRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.vo.ResultVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 车辆使用记录表 服务实现类
 * </p>
 *
 * @author wsl
 * @since 2022-05-19
 */
@Service
public class VehicleRecordServiceImpl extends ServiceImpl<VehicleRecordMapper, VehicleRecord> implements IVehicleRecordService {

    @Override
    public ResultVo queryVehicleRecordStatus(String empName) {
        List<VehicleRecord> list= baseMapper.queryVehicleRecordStatus(empName);
        return ResultVo.response(list);
    }

    @Override
    public ResultVo insertVehicleRecord(VehicleRecord vehicleRecord) {
        int i= baseMapper.insert(vehicleRecord);
        return i > 0 ? ResultVo.success("新增成功") : ResultVo.error("新增失败");
    }

}
